<?php 
    //includes
	//$userID = $_POST["users_idNum"];
	//$userID = intval($userID);
	//$complaint = $_POST["complaints_complaint"];
	//$ses_id = session_id();
	//include("../../database/connect.php");
	$userInfo = mysql_query("SELECT * FROM users WHERE idNum='$userID'");
	$info = mysql_fetch_array($userInfo);
	$complaintInfo = mysql_query("SELECT * FROM vomating WHERE idNum='$userID' and sessionID='$sessionID'");
	$row = mysql_fetch_array($complaintInfo);
    
    // from first form
	$ageLine = ($info['sex'] == 'male' ? "בן " : "בת ") . $info['age'] . ", ";
	
    //from second form
    $DurationUnits = $row['durationUnits'];
    switch ($DurationUnits)
    {
        case 'days':
            $DurationUnits = "ימים";
            continue;
        case 'weeks':
            $DurationUnits = "שבועות";
            continue;
        case 'months':
            $DurationUnits = "חודשים";
            continue;
        default:
            continue;
    }
    
    $timeSick = $row['duration'] . " " . $DurationUnits;
	$frequency = $row['frequency'];
    $frequencyUnits = $row['frequencyUnits'];
    
    switch ($frequencyUnits)
    {
        case 'days':
            $frequencyUnits = "יום";
            continue;
        case 'weeks':
            $frequencyUnits = "שבוע";
            continue;
        case 'months':
            $frequencyUnits = "חודש";
            continue;
        default:
            continue;
    }
    
    $content = $row['content'];
    
    switch ($content)
    {
        case 'אוכל':
            $content = "תכן כיבה ";
            continue;
        case 'דם':
            $content = "תכן דמי";
            continue;
        default:
            continue;
    }
    
    
	
    $History = $row['hasNausea'] ? "תחושת בחילה," : "ללא בחילות, ";

    $History .= $row['hasDizzi'] ? "תחושת סחרחורת, " : "ללא סחרחורות, ";
    
    $History .= $row['hasBurn'] ? "צרבות" : "ללא צרבות ";
    
    $History .= $row['foodRelated'] ? "עם קשר לאוכל," : "ללא קשר לאוכל, ";
    
    $History .= $row['hasHiccup'] ? "מלווה בשיהוקים חזקים, " : "ללא שיהוקים, ";
    
    $History .= $row['hasFever'] ? "עם חום," : "ללא חום, ";
    
    $History .= $row['hasShiver'] ? "תחושת צמרמורות/רעידות," : "ללא צמרמורות/רעידות, ";
    
    //Standatd
    $History .= $row['tookMedication'] ? "" : "לא ";
    $History .= "לקח תרופות בסמוך לתחילת התסמינים, ";
    $History .= $row['hadBefore'] ? "" : "לא ";
    $History .= "חווה אירוע כזה בעבר, ";
    $History .= $row['otherPerson'] ? "" : "לא ";
    $History .= "מציין אדם עם תסמינים דומים בקרבתו";
    

//--------------------Output--------------------------------
?>

<a class="entry"> <?php echo "הקאות מזה " . $timeSick . " של " .$content ?></a> 
<a class="entry"> <?php echo " " . $frequency ." פעמים ב". $frequencyUnits ?></a>
<a class="entry"> <?php echo $History?></a>
